import java.io.Serializable;

/**
 * This class contains the help topics for when someone search for help.
 * 
 * @author Interactive Syllabus
 * 
 */
public class HelpTopic implements Serializable
{
	private static final long serialVersionUID = -8405333406278415387L;
	private String name;
	private String body;
	
	public HelpTopic(String name, String body){
		this.name = name;
		this.body = body;
	}
	
	/**
	 * getName is a get method that returns the topic name for the particular HelpTopic object.
	 * 
	 * @return name
	 */
	public String getName(){
		return this.name;
	}
	
	/**
	 * getBody is a get method that returns the topic body for the particular HelpTopic object.
	 * 
	 * @return name
	 */
	public String getBody(){
		return this.body;
	}
	
	public boolean contains(String term){
		
		return (this.name.toLowerCase().contains(term.toLowerCase())||
				this.body.toLowerCase().contains(term.toLowerCase()));
	}
	
	@Override
	public String toString(){
		return this.getName();
	}
	
	
}
